package gov.nhso.prov.acc.servlets;

import gov.nhso.prov.acc.apps.acc67.ACC670000;
import gov.nhso.prov.acc.apps.acc67.ACC670101;
import gov.nhso.prov.acc.apps.acc67.ACC670102;
import gov.nhso.prov.acc.apps.acc67.ACC670103;
import gov.nhso.prov.acc.apps.acc67.ACC670104;
import gov.nhso.prov.acc.apps.acc67.Ajax;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class for Servlet: ACC67Servlet
 *
 */
 public class ACC67Servlet extends ServletDispatcher {
	private static final long serialVersionUID = 351479826852366486L;

	public void doProcess(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String url = "/index.jsp";
		try {
			this.setAllRequest(request);
			String app = (String) request.getAttribute("app");
			if (app.equals("ACC670000")) {
				ACC670000 acc670000 = new ACC670000(request, response);
				url = acc670000.url;
				acc670000 = null;
			} else if (app.equals("ACC670101")) {
				ACC670101 acc670101 = new ACC670101(request, response);
				url = acc670101.url;
				acc670101 = null;
			} else if (app.equals("ACC670102")) {
				ACC670102 acc670102 = new ACC670102(request, response);
				url = acc670102.url;
				acc670102 = null;
			} else if (app.equals("ACC670103")) {
				ACC670103 acc670103 = new ACC670103(request, response);
				url = acc670103.url;
				acc670103 = null;
			} else if (app.equals("ACC670104")) {
				ACC670104 acc670104 = new ACC670104(request, response);
				url = acc670104.url;
				acc670104 = null;
			} else if (app.equals("ajax")) {
				new Ajax(request, response);
				url = null;
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if(url != null && !url.equals("")){
				this.dispatcherForward(request, response, url);
			}
		}
	}
}